package org.example.controller;

import lombok.extern.slf4j.Slf4j;
import org.example.feignClient.ProductClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author limeng
 * @create 2021-06-08 9:50
 */
@RestController
@Slf4j
public class UserController {

    @Value("${server.port}")
    private Integer port;

    @Autowired
    private ProductClient productClient;

    @GetMapping("/user/test")
    public String test() {
        log.info("用户服务,当前端口号为:{}", port);
        String result = productClient.test();
        log.info("调用结果:{}", result);

        return "调用结果:" + result;
    }
}
